package com.ash.test.anno;

import com.ash.bean.anno.controller.UserController;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MySpringTestAnno {

    @Test
    public void test() {
        // 使用"spring.xml"和"spring-mybatis.xml"这两个配置文件创建Spring上下文
        ApplicationContext ac = new ClassPathXmlApplicationContext(new String[]{"beans-annotation.xml"});

        UserController uc = (UserController) ac.getBean("userController");
        uc.excute(null);
        uc = (UserController) ac.getBean("userController");
        uc.excute(null);

    }

}
